/**
 * author:Administrator
 * date:2013-5-21
 */
package com.roc.web.action.agent;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

/**
 * 
 * @author 陈锴
 * 
 * 代理商审核(复审)
 * 
 * 2014-08-11
 *
 */
public class AgentAuditingTwoSearchCondition extends BaseSearchCondition {
	

	private String orgCode;
	private String accountNo;
	private String realName;
	private String cardNo;
	private String mobile;
	private String status;       //代理商状态
	private String role;   //角色类型

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getOrderPartOfHQL()
	 */
	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		
		return "   ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getRowCountHQL()
	 */
	@Override
	protected String getRowCountHQL() {
		
		return " select count(*) from Operators o where 1=1  ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getSearchHQL()
	 */
	@Override
	protected String getSearchHQL() {
		
		return " from Operators o where 1=1 ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getWhereHQLFieldBeanList()
	 */
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();

		
		if (Constance.isNotEmpty(accountNo)) {
			filedBeanList.add(new WhereHQLFieldBean("o.accountNo", accountNo.trim(), "=", false));
		}

		if (Constance.isNotEmpty(realName)) {
			filedBeanList.add(new WhereHQLFieldBean("o.realName", realName.trim(),
					"LIKE", false, "ALL"));
		}
		if (Constance.isNotEmpty(mobile)) {
			filedBeanList.add(new WhereHQLFieldBean("o.mobile", mobile.trim(), "=", false));
		}
		if (Constance.isNotEmpty(cardNo)) {
			filedBeanList.add(new WhereHQLFieldBean("o.cardNo", cardNo.trim(), "=", false));
		}
		
		if (Constance.isNotEmpty(status)) {
			filedBeanList.add(new WhereHQLFieldBean("o.status", status, "=", false));
		}
		
		if (Constance.isNotEmpty(orgCode)) {
			filedBeanList.add(new WhereHQLFieldBean("o.orgCode", orgCode.trim(), "=", false));
		}
		
		filedBeanList.add(new WhereHQLFieldBean(" o.roleType IN ("+role+") "));

		return filedBeanList;
	}

	/**
	 * @return the accountNo
	 */
	public String getAccountNo() {
		return accountNo;
	}

	/**
	 * @param accountNo the accountNo to set
	 */
	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}

	/**
	 * @return the realName
	 */
	public String getRealName() {
		return realName;
	}

	/**
	 * @param realName the realName to set
	 */
	public void setRealName(String realName) {
		this.realName = realName;
	}

	/**
	 * @return the cardNo
	 */
	public String getCardNo() {
		return cardNo;
	}

	/**
	 * @param cardNo the cardNo to set
	 */
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

}
